<?php

/*

Change password (change_password.pro.php)

*/
ob_start();
$rank_check = 1;
include "global.inc.php";

if ((!$old_pass) or (!$new_pass1) or (!$new_pass2))
{
	die(header(error("change_password.php?game=$game","Don't leave anything blank.")));
}
if ($new_pass1 != $new_pass2)
{
	die(header(error("change_password.php?game=$game","Your new passwords didn't match.")));
}

$check_pass = md5($old_pass);
if ($check_pass != $getInfo[password])
{
	die(header(error("change_password.php?game=$game","Your old password is incorrect.")));
}
else
{
	$new_pass = md5($new_pass1);
	mysql_query("UPDATE members2 SET password = '$new_pass' WHERE username = '$username' AND game = '$game'");
	header(error("login.php?game=$game","Your password has been changed, please log in."));
}

?>